package com.surfmanager.model;
// Generated Apr 4, 2014 7:05:16 PM by Hibernate Tools 3.6.0

import java.util.Date;
import java.util.Set;
import java.util.TreeSet;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;




/**
        Nom, Prénom.
•	Nick Name.
•	Age.
•	Photo.
•	Adresse Mail.
•	Numéro de téléphone.
•	Note Appréciation participant:
•	Note Appréciation Organisateur :
•	Nombre de participations :
•	Nombre d’évènements organisés.

 * @author eamiker
 */

@Entity
@Table(name="profile")
public class Profile  implements java.io.Serializable {

    @Id
    @Column(name="id")
    @GeneratedValue	
     private int id;
    
    @Column(name="firstname")
    @Size(min=2, max=30) 
     private String firstName;
    
    @Column(name="lastname")
    @Size(min=2, max=30) 
     private String lastName;
    
    @Column(name="username")
    @Size(min=2, max=30) 
     private String userName;
    
    
    @Column(name="age")
     private int age;
    
    @Column(name="password")
    @NotNull @NotEmpty
     private String password;
    
    @Column(name="email")
    @NotEmpty @Email
     private String email;
    
    @Column(name="phone")
     private String phone;
            
            
    @Column(name="noteparticipant")
     private int noteParticipant;
    
    
    @Column(name="noteorganizer")
     private int noteOrganizer;
    
    @Column(name="participations")
     private int participations;
    
    
    @Column(name="organizations")
     private int organizations;
    
    @Column(name="created")
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date created;
    
    @OneToMany(mappedBy="profile" , fetch = FetchType.EAGER)
    private Set<SurfSession> sessions  = new TreeSet<SurfSession>();
    
      @OneToMany(mappedBy="profile" , fetch = FetchType.EAGER)
    private Set<Trip> trips  = new TreeSet<Trip>();
    
    
    public Profile() {
    }

    public Profile(String firstName, String lastName, String userName, int age, String password, String email, String phone) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.userName = userName;
        this.age = age;
        this.password = password;
        this.email = email;
        this.phone = phone;
        this.noteParticipant = 0;
        this.noteOrganizer = 0;
        this.participations = 0;
        this.organizations = 0;
      }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getNoteParticipant() {
        return noteParticipant;
    }

    public void setNoteParticipant(int noteParticipant) {
        this.noteParticipant = noteParticipant;
    }

    public int getNoteOrganizer() {
        return noteOrganizer;
    }

    public void setNoteOrganizer(int noteOrganizer) {
        this.noteOrganizer = noteOrganizer;
    }

    public int getParticipations() {
        return participations;
    }

    public void setParticipations(int participations) {
        this.participations = participations;
    }

    public int getOrganizations() {
        return organizations;
    }

    public void setOrganizations(int organizations) {
        this.organizations = organizations;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Set<SurfSession> getSessions() {
        return sessions;
    }

    public void setSessions(Set<SurfSession> sessions) {
        this.sessions = sessions;
    }

    public Set<Trip> getTrips() {
        return trips;
    }

    public void setTrips(Set<Trip> trips) {
        this.trips = trips;
    }

    @Override
    public String toString() {
        return "Profile{" + "id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", userName=" + userName + ", age=" + age + ", password=" + password + ", email=" + email + ", phone=" + phone + ", noteParticipant=" + noteParticipant + ", noteOrganizer=" + noteOrganizer + ", participations=" + participations + ", organizations=" + organizations + ", created=" + created + ", sessions=" + sessions + ", trips=" + trips + '}';
    }

    
    
    
    
   
    




}


